<!DOCTYPE html>
<!-- 
Template Name: Metronic - Responsive Admin Dashboard Template build with Twitter Bootstrap 3.1.1
Version: 2.0.2
Author: KeenThemes
Website: http://www.keenthemes.com/
Contact: support@keenthemes.com
Purchase: http://themeforest.net/item/metronic-responsive-admin-dashboard-template/4021469?ref=keenthemes
License: You must have a valid license purchased only from themeforest(the above link) in order to legally use the theme for your project.
-->
<!--[if IE 8]> <html lang="en" class="ie8 no-js"> <![endif]-->
<!--[if IE 9]> <html lang="en" class="ie9 no-js"> <![endif]-->
<!--[if !IE]><!-->
<!--<![endif]-->
<!-- BEGIN HEAD -->
<!-- BEGIN BODY -->
<body class="page-header-fixed">
<!-- BEGIN CONTAINER -->
	<!-- BEGIN CONTENT -->
		<!--表格操作按钮组-->
		<div>
		</div>
			<table class="table table-striped table-bordered table-hover" id="table_1">
			<thead>
				<tr>
					<th>科目类型</th>
					<th>科目名称</th>
					<th style="text-align: left;padding-left:8px">科目编码</th>
					<th>父级科目</th>
					<th>账号类型</th>
					<th>是否使用</th>
					<th>操作</th>
				</tr>
			</thead>
			<tbody>
				<tr class="odd gradeX" ng-repeat="subject in subjectList track by $index  " on-loaded="{{$last}}" target-table="table_1">
					<td>
						<span ng-bind="subject.parentSubjectCode=='#'?'一级科目':''"></span>
					</td>
					<td>
						<span ng-bind="subject.subjectName"></span>
					</td>
					<td style="text-align: left;">
						<span ng-bind="subject.subjectCode" ></span>
					</td>
					<td>
						<span ng-bind="subject.parentSubjectCode=='#'?'':(subject.parentSubjectCode | getValueInArgFilter : subjectMap : 'subjectName')"></span>
					</td>
					<td>
						<span ng-bind="subject.subjectType  | getValueInStaticFilter : 'subjectTypeArray'"></span>
					</td>
					<td>
						<span ng-bind="subject.isValid | getValueInStaticFilter : 'validArray'"></span>
					</td>
					
					<td>
						<a class="btn" href="javascript:;"  data-target="#subjectModel" 
						data-toggle="modal" ng-click="addChildrenSubject(subject);" ng-show="subject.parentSubjectCode=='#'">
							添加二级科目
						</a>
						<a class="btn" href="javascript:;"  data-target="#subjectModel" 
						data-toggle="modal" ng-click="updateSubject(subject);" ng-show="subject.parentSubjectCode=='#'">
							查看
						</a>
						<a class="btn" href="javascript:;"  data-target="#subjectModel" 
						data-toggle="modal" ng-click="updateSubject(subject);" ng-show="subject.parentSubjectCode!='#'">
							修改
						</a>
					</td>
				</tr>
			</tbody>
			</table>
		
		<div id="subjectModel" class="modal fade" role="dialog"
		aria-hidden="true" data-backdrop="false">
		<div class="modal-dialog">
			<div class="modal-content">
				<div class="modal-header">
					<button type="button" class="close" data-dismiss="modal"
						aria-hidden="true">×</button>
					<h4 class="modal-title">账目类型维护</h4>
				</div>
				<div class="modal-body form">
					<div class="form-group">
						<div class="row">
							<label class="col-sm-3 control-label">科目名称</label>
							<div class="col-sm-9">
								<div class="input-group">
									<input type="text" ng-model="selectedSubject.subjectName"  
										class="form-control bValidate" key="required,maxlength_20" ng-readonly="selectedSubject.parentSubjectCode=='#'"/>
								</div>
							</div>
						</div>
						<div class="row">
							<label class="col-sm-3 control-label">父级科目编码</label>
							<div class="col-sm-9">
								<div class="input-group">
									<input type="text" ng-model="selectedSubject.parentSubjectCode"
										ng-readonly="parentCodeReadOnly||selectedSubject.parentSubjectCode=='#'" class="form-control" />
								</div>
							</div>
						</div>
						<div class="row">
							<label class="col-sm-3 control-label">使用状态</label>
							<div class="col-md-9">
								<div class="input-group">
									<label class="radio-inline"> <input
										ng-model="selectedSubject.isValid" type="radio" value="1"
										ng-selected="selectedSubject.isValid==1"
										ng-disabled="selectedSubject.parentSubjectCode=='#'"> 启用
									</label> <label class="radio-inline"> <input
										ng-model="selectedSubject.isValid" type="radio" value="0"
										ng-selected="selectedSubject.isValid==0"
										ng-disabled="selectedSubject.parentSubjectCode=='#'"> 停用
									</label>
								</div>
							</div>
						</div>
						<div class="row">
							<label class="col-sm-3 control-label">账户类型</label>
							<div class="col-md-9">
								<div class="input-group">
									<label class="radio-inline"> <input
										ng-model="selectedSubject.subjectType" type="radio" value="0"
										class="bValidate" key="required" name="subjectType"
										ng-selected="selectedSubject.subjectType==0"
										ng-disabled="typeReadOnly||selectedSubject.parentSubjectCode=='#'"> 资产
									</label> <label class="radio-inline"> <input
										ng-model="selectedSubject.subjectType" type="radio" value="1"
										name="subjectType"
										ng-selected="selectedSubject.subjectType==1"
										ng-disabled="typeReadOnly||selectedSubject.parentSubjectCode=='#'"> 损益
									</label> <label class="radio-inline"> <input
										ng-model="selectedSubject.subjectType" type="radio" value="2"
										name="subjectType"
										ng-selected="selectedSubject.subjectType==2"
										ng-disabled="typeReadOnly||selectedSubject.parentSubjectCode=='#'"> 负债
									</label> <label class="radio-inline"> <input
										ng-model="selectedSubject.subjectType" type="radio" value="3"
										name="subjectType"
										ng-selected="selectedSubject.subjectType==3"
										ng-disabled="typeReadOnly||selectedSubject.parentSubjectCode=='#'"> 所有者权益
									</label>
								</div>
							</div>
						</div>
					</div>

				</div>
				<div class="modal-footer">
					<button type="button" id="closeButton" class="btn btn-danger"
						data-dismiss="modal">
						<i class="fa fa-times"></i>关闭
					</button>
					<button type="button" class="btn btn-primary"
						ng-click="modifySubject();" ng-show="selectedSubject.parentSubjectCode!='#'">
						<i class="fa fa-check"></i>保存
					</button>
				</div>
			</div>
		</div>
	</div>
		

</div>
	<!-- END CONTENT -->

<!-- END CONTAINER -->

<!-- BEGIN JAVASCRIPTS(Load javascripts at bottom, this will reduce page load time) -->
<!-- BEGIN CORE PLUGINS -->



</body>
<!-- END BODY -->
</html>
<script src="manageView/assets/scripts/public.js" type="text/javascript"></script>
<script>

// setTimeout(function(){

// var tablesOption = new datatablesFunc();
//         var table1 = $('#table_1');
//         var tb1 = table1.DataTable(tablesOption);
//         table1.bTableAll();
//         $("#table_1_filter input")
//   .unbind(
//         'keyup.DT search.DT input.DT paste.DT cut.DT'
//       )
//       .unbind( 'keypress.DT').attr("ng-keyup","searchModle();")
//       .attr("ng-model","searchInput");
// }, 3000);

</script>